<template>
    <div class="card">
        <h3>{{ pet.name }}</h3>
        <p>类型: {{ pet.type }}</p>
        <p>年龄: {{ pet.age }} 岁</p>
        <button @click="removePet" class="remove-btn">删除</button>
        <button @click="editPet" class="edit-btn">编辑</button>
    </div>
</template>

<script>
export default {
    props: {
        pet: Object
    },
    methods: {
        removePet() {
            this.$emit('remove')
        },
        editPet() {
            this.$emit('edit')
        }
    }
}
</script>

<style scoped>
.card {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    text-align: left;
}

.remove-btn,
.edit-btn {
    margin-top: 10px;
    padding: 5px 10px;
    border: none;
    cursor: pointer;
}

.remove-btn {
    background-color: #e74c3c;
    color: white;
}

.edit-btn {
    background-color: #3498db;
    color: white;
}
</style>
